The present invention is related generally to the field of computer graphics, and more particularly, to a system and method for storing graphics data in a computer graphics processing system.
As with any computer processing intensive system, computer graphics processing systems have a need to store and retrieve data quickly and efficiently. Typical graphics data include vertex information, color values, pixel coordinates, lighting conditions, and the like. Large amounts of graphics data are processed in producing realistic graphics images. As graphics images become more realistic and detailed, more graphics data must be processed in producing those computer graphics images. Moreover, in graphics applications where graphics images must be refreshed quickly, such as computer animation, retrieving and processing graphics data must occur fast enough for the animation sequences to appear smooth and continuous. Consequently, not only is more memory needed, but being able to quickly access data from memory is necessary as well.
Various hardware and software methods have been developed to address the memory and memory access issues previously described. Including more memory in a graphics processing system is one means of addressing the problems. However, this does not necessarily resolve the issue of high-speed access to the data stored by the memory. Another approach has been to embed a portion of memory in a graphics processing device. That is, a limited amount of memory is included on the same semiconductor substrate on which the graphics processing device is fabricated. The memory is specifically designated to store graphics data for processing, and its proximity to the rest of the graphics processing device decreases the time to retrieve the data. However, embedding memory with the graphics processing device is relatively costly, and so the amount of memory that is typically embedded in a system is limited.
As the limits of current technology on the amount of embedded memory that may be included in a system and the access speed of memory are approached, another method developed to resolve the memory demands of graphics processing systems is to store the graphics data in memory in a more efficient manner. That is, the graphics data is stored in a manner that either reduces the amount, and thus reduces the need for additional memory, or stores the graphics data in a format that is conducive to fast access. One such common method of reducing the amount of graphics data is through compression. One type of graphics data compression is accomplished by truncating or ignoring a portion of the graphics data representing a pixel during storage or retrieval. Although the precision of the graphics data is reduced by the data compression, the amount of compression selected is such that an acceptable level of resolution is maintained for the graphics image.
The benefit of compressing graphics data is that the amount of data required to be processed and stored is reduced. However, a graphics system is typically designed to either compress the graphics data or not. That is, a system which benefits from compressing data typically must compress all graphics data, and is precluded from storing and retrieving graphics data in an uncompressed format. Thus, compressed data and uncompressed data cannot be stored contiguously in a memory space in these systems. Consequently, in situations where compression is not needed, or maintaining the precision of the graphics data is desired, compressing the graphics data may be disadvantageous. Unfortunately, conventional graphics processing systems lack the flexibility to store graphics data in multiple data formats.
Therefore, there is a need for a graphics processing system having the flexibility to store graphics data in various data formats.
The present invention is directed to a system and method for storing data in memory in either a packed or unpacked format contiguously. The data is stored in either the packed or unpacked format and is provided in an unpacked format when retrieved from memory. The memory system includes a memory having packed and unpacked data stored in lines of data, a register to store a line of data it receives from the memory, and a selection circuit coupled to the memory and the register to receive a line of data from each. The selection circuit selects a portion of data from the lines of data presented to it by the memory and the register to be provided to a data bus. The selection circuit may be directed to select portions of data according to a select signal provided by a memory address generator. The memory address generator calculates the select signal from an expected address at which the data is expected to be located. A second register and a second selection circuit may also be included in the memory system. The second register is coupled to the data bus to receive a line of data and the second selection circuit is coupled to both the second register and the data bus to receive a line of data from each. The selection circuit is further coupled to the memory, to which the selection circuit provides a data that is selected from the lines of data presented to it by the second register and the data bus.